package plutuscat.shishicai.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class SampleController {

	@RequestMapping("/")
	@ResponseBody
	String home() {
		return "Hello World!";
	}

	@RequestMapping("/sample")
	String sample(@RequestParam(defaultValue = "sam") String name, Model model) {
		model.addAttribute("name", name);
		return "sample";
	}

	@RequestMapping("sbadmin")
	String sbadmin() {
		System.err.println("sbadmin");
		return "/index";
	}

}